package cn.com.zero.common.log.schedule;

import cn.com.zero.common.log.service.ILogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

/**
 * @author xiongxj
 * @version 1.0.0
 * @Description 导历史日志任务
 * @createTime 2023/2/9 16:32
 */
@EnableScheduling
@Configuration
public class ExportHistoryLogTask {

    private ILogService logService;

    /**
     * 每日凌晨 00:10:00时，执行日志导历史操作
     */
    @Scheduled(cron = "0 10 0 * * ?")
    public void exportHistoryLog() {
        logService.exportHistoryLog();
    }

    @Autowired
    public void setLogService(ILogService logService) {
        this.logService = logService;
    }
}
